package com.hdc.autotest;

import org.junit.jupiter.api.*;
import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;

@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public class AotoTest3 {
    private ChromeDriver driver = new ChromeDriver();

    @Test
    @Order(1)
    void test() {
        driver.get("https://www.baidu.com");
        String text = driver.findElement(By.cssSelector("#su")).getAttribute("value");
        Assertions.assertEquals("百度一下", text);
        driver.quit();
    }

    @Test
    @Order(2)
    void test2() {
        driver.get("https://www.baidu.com");
        String text = driver.findElement(By.cssSelector("#su")).getAttribute("value");
        Assertions.assertTrue(text.equals("百度一下"));
        driver.quit();
    }
}
